<?php
/**
 * Created by PhpStorm.
 * 处理
 * User: 独行侠
 * Date: 2018/1/29
 * Time: 19:34
 */

namespace SDXApi\Controller;


use SDXApi\Service\GoodsPriceTagService;

class GoodsPriceTagController extends AppController {

    protected $GoodsPriceTagService;

    public function __construct() {
        set_time_limit(0);
        $this->GoodsPriceTagService = new GoodsPriceTagService();
    }

    public function update_store(){
        $goods_id = array(
            '110','113','114'
        );
        $goods_info = $this->GoodsPriceTagService->improtGoods($goods_id);
        print_r($goods_info);exit;

        $res = $this->GoodsPriceTagService->improtGoodsList();
        print_r($res);exit;

        //$res = $this->GoodsPriceTagService->updateStore();

    }

    public function improt_goods_all(){
        $res = $this->GoodsPriceTagService->improtGoodsList();
        print_r($res);exit;
    }

    /**
     * 商品导入价格标签服务
     * @author Min
     */
    public function improtGoods(){
        $goods_id = I('post.goods_id');
        if(empty($goods_id)){
            returnApiError('参数有误');
        }

        $res = $this->GoodsPriceTagService->improtGoods($goods_id);
        if($res){
            returnApiSuccess($res);
        }else{
            returnApiError('操作失败');
        }


    }

}